﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using ECommerce.Model.Order;
using Jzy.Core.Common;
using ECommerce.DAL.Order;
using Jzy.Core.Log.Exceptions;

namespace ECommerce.BLL.Order
{
    public class ECOrderBO : CommonOperate<ECOrderInfo>
    {
        private ECOrderDAL _order;
        public ECOrderBO()
        {
            _order = new ECOrderDAL();
        }

        public override ECOrderInfo GetInfo(object id)
        {
            ECOrderInfo info = base.GetInfo(id);
            info.GetProducts = orderID => (new ECOrderProductBO()).GetList(orderID);
            return info;
        }

        public long GetOrderID()
        {
            long id = _order.GetOrderID();
            return id;
        }

        public void SetOrderState(List<string> ids, OrderState orderState)
        {
            _order.SetOrderState(ids, orderState);
        }

        public List<ECOrderInfo> GetList(string ids)
        {
            return _order.GetList(ids);
        }

        
    }
}
